This disclosure relates to memory management.
Memory management units (MMUs) attend to the translation of virtual memory addresses into physical memory addresses.
A data processing apparatus typically provides each running program with access to a virtual address space defined by virtual memory addresses. Each program sees its own virtual address space which contains instructions and data for use by that program. Amongst other established advantages, the use of virtual addressing allows the operating system to control memory access by inhibiting one program from accessing or corrupting information used by another program.
When an access is required to a virtual memory address, it is first necessary to translate the virtual memory address to a physical memory address so that the required information can be obtained from or written to the physical memory or a physical memory cache.
A cache known as a translation lookaside buffer (TLB) may be used as part of the address translation process. The TLB stores recently or commonly used translations between virtual and physical memory addresses. So, as a first step in an address translation process, the TLB is consulted to detect whether the TLB already contains the required address translation. If not, then a more involved translation process may be used, for example involving consulting so-called page tables holding address translation information, typically resulting in the TLB being populated with the required translation.
Multiple stage MMUs are used in some situations. In this arrangement, two levels of translation are in fact used. A virtual address (VA) required by an executing program or other system module such as a graphics processing unit (GPU) is translated to an intermediate physical address (IPA) by a first MMU stage. The IPA is translated to a physical address (PA) by a second MMU stage. One reason why multiple stage translation is used is for security of information handling when multiple operating systems (OS) may be in use on respective “virtual machines” running on the same processor. A particular OS is exposed to the VA to IPA translation, whereas only a hypervisor (software which oversees the running of the virtual machines) has oversight of the stage 2 (IPA to PA) translation.